package cn.lycode.system.domain.dto.sysdict;

import cn.lycode.system.domain.entity.SysDictType;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * 字典类型添加
 */
@Data
public class SysDictTypeAddDTO {

    @NotBlank(message = "字典名称不能为空")
    private String typeName; //字典名称

    @NotBlank(message = "字典码不能为空")
    private String typeCode; //字典码(英文)

    @NotBlank(message = "字典分类不能为空")
    private String dictClassify; //字典分类

    private String remark; //备注

    public SysDictType buildEntity(){
        SysDictType sysDictType = new SysDictType();
        sysDictType.setTypeName(typeName);
        sysDictType.setTypeCode(typeCode);
        sysDictType.setDictClassify(dictClassify);
        sysDictType.setRemark(remark);
        return sysDictType;
    }

}
